package com.fjnldx.mes.controller.monitor;

import com.fjnldx.mes.domain.domainReq.DictionariesOne;
import com.fjnldx.mes.domain.domainReq.DictionariesTwo;
import com.fjnldx.mes.domain.domainReq.ParameterModificationRecord;
import com.fjnldx.mes.domain.domainRes.QueryResult;
import com.fjnldx.mes.domain.domainRes.Result;
import com.fjnldx.mes.domain.domainRes.XsRealTimeDataOfQuery;
import com.fjnldx.mes.service.monitor.MonitorService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/monitor")
@Api(value = "监控中心", tags = "监控中心")
public class MonitorController {
    @Resource
    MonitorService monitorService;

    @PostMapping("/getRealTimeDataOfDictionariesOne")
    @ApiOperation(value = "车台实时数据-数据字典-级联1", notes = "车台实时数据-数据字典-级联1")
    public Result getRealTimeDataOfDictionariesOne(@RequestBody DictionariesOne data) throws Exception {
        return monitorService.getRealTimeDataOfDictionariesOne(data);
    }

    @PostMapping("/getRealTimeDataOfDictionariesTwo")
    @ApiOperation(value = "车台实时数据-数据字典-级联2", notes = "车台实时数据-数据字典-级联2")
    public Result getRealTimeDataOfDictionariesTwo(@RequestBody DictionariesTwo data) throws Exception {
        return monitorService.getRealTimeDataOfDictionariesTwo(data);
    }

    @PostMapping("/realTimeData")
    @ApiOperation(value = "不同工序-车台实时数据", notes = "不同工序-车台实时数据")
    public QueryResult realTimeData(@RequestBody XsRealTimeDataOfQuery data) throws Exception {
        return monitorService.realTimeData(data);
    }

    @GetMapping("/parameterModificationRecord")
    @ApiOperation(value = "参数修改记录", notes = "参数修改记录")
    public Result parameterModificationRecord(ParameterModificationRecord data) {
        return monitorService.parameterModificationRecord(data);
    }

}
